from rest_framework import serializers
from goods.models import SPUSpecification

#1,specs序列化器
class SpecsSerializer(serializers.ModelSerializer):

    #1,重写spu,spu_id
    spu = serializers.StringRelatedField(read_only=True)
    spu_id = serializers.IntegerField()
    
    class Meta:
        model = SPUSpecification
        fields = "__all__"